#pragma once

#include "../stdafx.h"

class CProcess : public CThreadObject 
{
public:
	CProcess(string imageCode, HANDLE userThread);
	virtual ~CProcess();

	// Thread Support
    virtual void InitThread ();
    virtual void Run ();
    virtual void FlushThread ();

public:

	// property accessors
	unsigned char		getProcessStatus() {Lock lock(_processLock); return _processStatus;};
	void				setProcessStatus(unsigned char status) {Lock lock(_processLock); _processStatus = status;};
	unsigned char		getProcessPriority()  {Lock lock(_processLock); return _processPriority;};
	void				setProcessPriority(unsigned char priority) {Lock lock(_processLock); _processPriority = priority;};

protected:

	unsigned char		_processStatus;
	unsigned char		_processPriority;
	lua_State*			_processState;
	unsigned int		_processId;
	void*				_processUser;
	string				_processName;

	Mutex				_processLock;

};